package me.yuxiaoyao.example.jpa.nativesql.entity;

import javax.persistence.*;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Arrays;

/**
 * @author kerryzhang on 2020/12/16
 */


@Entity(name = "native_sql")
@Table(name = "native_sql", schema = "native_sql_test")
public class NativeSql {
    private Long id;
    private Integer age;
    private Byte sex;
    private Byte widget;
    private String name;
    private String nickname;
    private String password;
    private String desp;
    private byte[] avatar;
    private byte[] content;
    private Date birDate;
    private Time birTime;
    private Timestamp bir;
    private Timestamp birStamp;
    private Integer money;
    private Double moneyD;
    private Double moneyF;
    private byte[] bin;
    private byte[] binL;

    @Id
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "age")
    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Basic
    @Column(name = "sex")
    public Byte getSex() {
        return sex;
    }

    public void setSex(Byte sex) {
        this.sex = sex;
    }

    @Basic
    @Column(name = "widget")
    public Byte getWidget() {
        return widget;
    }

    public void setWidget(Byte widget) {
        this.widget = widget;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "nickname")
    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @Basic
    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "desp")
    public String getDesp() {
        return desp;
    }

    public void setDesp(String desp) {
        this.desp = desp;
    }

    @Basic
    @Column(name = "avatar")
    public byte[] getAvatar() {
        return avatar;
    }

    public void setAvatar(byte[] avatar) {
        this.avatar = avatar;
    }

    @Basic
    @Column(name = "content")
    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    @Basic
    @Column(name = "bir_date")
    public Date getBirDate() {
        return birDate;
    }

    public void setBirDate(Date birDate) {
        this.birDate = birDate;
    }

    @Basic
    @Column(name = "bir_time")
    public Time getBirTime() {
        return birTime;
    }

    public void setBirTime(Time birTime) {
        this.birTime = birTime;
    }

    @Basic
    @Column(name = "bir")
    public Timestamp getBir() {
        return bir;
    }

    public void setBir(Timestamp bir) {
        this.bir = bir;
    }

    @Basic
    @Column(name = "bir_stamp")
    public Timestamp getBirStamp() {
        return birStamp;
    }

    public void setBirStamp(Timestamp birStamp) {
        this.birStamp = birStamp;
    }


    @Basic
    @Column(name = "money")
    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    @Basic
    @Column(name = "money_d")
    public Double getMoneyD() {
        return moneyD;
    }

    public void setMoneyD(Double moneyD) {
        this.moneyD = moneyD;
    }

    @Basic
    @Column(name = "money_f")
    public Double getMoneyF() {
        return moneyF;
    }

    public void setMoneyF(Double moneyF) {
        this.moneyF = moneyF;
    }

    @Basic
    @Column(name = "bin")
    public byte[] getBin() {
        return bin;
    }

    public void setBin(byte[] bin) {
        this.bin = bin;
    }

    @Basic
    @Column(name = "bin_l")
    public byte[] getBinL() {
        return binL;
    }

    public void setBinL(byte[] binL) {
        this.binL = binL;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        NativeSql nativeSql = (NativeSql) o;

        if (id != nativeSql.id) return false;
        if (age != null ? !age.equals(nativeSql.age) : nativeSql.age != null) return false;
        if (sex != null ? !sex.equals(nativeSql.sex) : nativeSql.sex != null) return false;
        if (widget != null ? !widget.equals(nativeSql.widget) : nativeSql.widget != null) return false;
        if (name != null ? !name.equals(nativeSql.name) : nativeSql.name != null) return false;
        if (nickname != null ? !nickname.equals(nativeSql.nickname) : nativeSql.nickname != null) return false;
        if (password != null ? !password.equals(nativeSql.password) : nativeSql.password != null) return false;
        if (desp != null ? !desp.equals(nativeSql.desp) : nativeSql.desp != null) return false;
        if (!Arrays.equals(avatar, nativeSql.avatar)) return false;
        if (!Arrays.equals(content, nativeSql.content)) return false;
        if (birDate != null ? !birDate.equals(nativeSql.birDate) : nativeSql.birDate != null) return false;
        if (birTime != null ? !birTime.equals(nativeSql.birTime) : nativeSql.birTime != null) return false;
        if (bir != null ? !bir.equals(nativeSql.bir) : nativeSql.bir != null) return false;
        if (birStamp != null ? !birStamp.equals(nativeSql.birStamp) : nativeSql.birStamp != null) return false;
        if (money != null ? !money.equals(nativeSql.money) : nativeSql.money != null) return false;
        if (moneyD != null ? !moneyD.equals(nativeSql.moneyD) : nativeSql.moneyD != null) return false;
        if (moneyF != null ? !moneyF.equals(nativeSql.moneyF) : nativeSql.moneyF != null) return false;
        if (!Arrays.equals(bin, nativeSql.bin)) return false;
        if (!Arrays.equals(binL, nativeSql.binL)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (age != null ? age.hashCode() : 0);
        result = 31 * result + (sex != null ? sex.hashCode() : 0);
        result = 31 * result + (widget != null ? widget.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (nickname != null ? nickname.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (desp != null ? desp.hashCode() : 0);
        result = 31 * result + Arrays.hashCode(avatar);
        result = 31 * result + Arrays.hashCode(content);
        result = 31 * result + (birDate != null ? birDate.hashCode() : 0);
        result = 31 * result + (birTime != null ? birTime.hashCode() : 0);
        result = 31 * result + (bir != null ? bir.hashCode() : 0);
        result = 31 * result + (birStamp != null ? birStamp.hashCode() : 0);
        result = 31 * result + (money != null ? money.hashCode() : 0);
        result = 31 * result + (moneyD != null ? moneyD.hashCode() : 0);
        result = 31 * result + (moneyF != null ? moneyF.hashCode() : 0);
        result = 31 * result + Arrays.hashCode(bin);
        result = 31 * result + Arrays.hashCode(binL);
        return result;
    }
}
